From ea990bcd820bed65a6cc6ba5fcb2e372918cd6af Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 Dec 2006 17:30:03 +0000 Subject: [PATCH] (Regexp Search): Explain why forward and reverse regexp search are not mirror images. --- man/search.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/man/search.texi b/man/search.texi index 67b61aeac07..532d58fb9d8 100644 --- a/man/search.texi +++ b/man/search.texi @@ -488,6 +488,13 @@ search can make the cursor move back and start again. For example, if you have searched for @samp{foo} and you add @samp{\|bar}, the cursor backs up in case the first @samp{bar} precedes the first @samp{foo}. + Forward and backward regexp search are not symmetrical, because +regexp matching in Emacs always operates forward, starting with the +beginning of the regexp. Thus, forward regexp search scans forward, +trying a forward match at each possible starting position. Backward +regexp search scans backward, trying a forward match at each possible +starting position. These search methods are not mirror images. + @findex re-search-forward @findex re-search-backward Nonincremental search for a regexp is done by the functions -- 2.30.2